<template>
    <div class="login-warp" :style="{height: height +'px'}">
      <login-header/>
      <login-request :role="role"/>
      <login-footer/>
      <remote-js src="https://pv.sohu.com/cityjson?ie=utf-8" @load="loadIp" />
      <slogan class="mg-top-xxl"/>
    </div>
</template>
<script>
  import loginHeader from '../component/login-header';
  import loginFooter from '../component/login-footer';
  import loginRequest from '../component/login-request';
  import importJs from '@cmpt_com/importJs'
  import Slogan from '@cmpt/slogan'

  import {
    getRole,
  } from '@utils/role'

  export default {
    name: 'index',
    data(){
        return {
          role: getRole() || '1',
          height: window.innerHeight
        }
    },
    components:{
      [loginHeader.name]: loginHeader,
      [loginFooter.name]: loginFooter,
      [loginRequest.name]: loginRequest,
      [importJs.name]: importJs,
      [Slogan.name]: Slogan,
    },
    
    methods: {
      loadIp(){
        // 保存当前地址以及ip
        localStorage.setItem('local_ip', returnCitySN["cip"])
        localStorage.setItem('local_city', returnCitySN["cname"])
        localStorage.setItem('local_zone_id', returnCitySN["cid"])
      }
    },
    
    created() {
      // 设置微信、app分享
      this.$set_share({
        title: `优采平台登录`,
      })
    },

    mounted () {
      const _self = this;
      window.onresize = () => {
        _self.height = window.innerHeight
      }
    },
  }
</script>

<style lang="less" scoped>
  @import '~@style_m/basic/utils/index.less';
  .login-warp {
    background: white;
    padding: 0 25px;
  }
</style>
